<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8" >
	<meta >
	<title>Demo Test</title>
	<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
	<script src="https://cdn.bootcss.com/moment.js/2.10.6/moment.js"></script>
	<!-- <script src="https://cdn.bootcss.com/moment-timezone/0.4.1/moment-timezone.js"></script> -->
	<script src="https://cdn.bootcss.com/moment-timezone/0.4.1/moment-timezone-with-data.js"></script>
	
	<script th:inline="javascript">
		/* 
		var time; 
		var date = [[${#dates.createNow()}]];
		$(document).ready(function(){
		    
		    $.ajax({
		        url: "time",
		        type: "post",
		        dataType: "json",
		        data: {
		            date: date
		        },
		        troditional:true,
		        success: function(result){
		            //alert(result.dateTime);
		            time = result.dateTime;
		            alert(result.dateTime);
					
		   			//$("#dateId").val(moment((moment.utc(result.dateTime))).format('MM/DD/YYYY HH:mm:ss'));  		   			
		   			//$("#dateId").val(moment(result.dateTime).format('MM/DD/YYYY HH:mm:ss'));  
		   			//var zone = moment.tz.zone("America/New_York");
		   			//$("h2").text(moment().utcOffset("America/Los_Angeles"));
		        }
		        
		    }); 

  
		})
		 */
		function dianji(){
		    //alert(moment((moment.utc($("#dateId").val()))).format('MM/DD/YYYY HH:mm:ss.SSS'));
		    alert(($('#dateId').val()));

		    $.ajax({
		        url: "getTime",
		        type: "post",
		        dataType: "json",
		        data: {
		           // date:[[${#dates.createNow()}]]
		           // submittedDate: moment((moment.utc($("#dateId").val()))).format('MM/DD/YYYY HH:mm:ss')
		            submittedDate: $('#dateId').val()
		        },
		        troditional:true,
		        success: function(result){

		        }
		        
		    });
		}
	
	
	</script>
</head>

<body>
	<!-- 
	<h2>[[${#dates.format(#dates.createNow(), "MM/dd/yyy HH:mm")}]]</h2>
	<h2>[[${#dates.format(#calendars.createForTimeZone(#calendars.year(#dates.createNow()), #calendars.month(#dates.createNow()), #calendars.day(#dates.createNow()),#calendars.hour(#dates.createNow()),#calendars.minute(#dates.createNow()),'CST'), 'MM/dd/yyyy HH:mm')}]]</h2>
	<h2>[[${#dates.format(#calendars.createForTimeZone(#calendars.year(#dates.createNow()), #calendars.month(#dates.createNow()), #calendars.day(#dates.createNow()),#calendars.hour(#dates.createNow()),#calendars.minute(#dates.createNow()),'UTC'), 'MM/dd/yyyy HH:mm')}]]</h2>
	<h2>[[${#locale.country}]]</h2>
	<h2>[[${#dates.format(#dates.createNowForTimeZone("America/Los_Angeles"), "MM/dd/yyy HH:mm")}]]</h2>
	-->
	<h3>============================================</h3>
	<h1>Success!!!!!!!!!!!!!!</h1>
	<!-- <h2 id="dateId">[[${#dates.format(date, "yyyy-MM-dd'T'HH:mm:ss.SSSXXX")}]]</h2> -->
	<input id="dateId" th:value="${#dates.format(date, &quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;)}">
	<input type="button" id="button" value="submit" onclick="dianji();">
	
</body>
</html>